package com.aaa.a1110.demo02;

/**
 * @author 荆豪峰
 * @version 1.0
 */
public class Test {
    public static void main(String[] args) {
        Shuang12 shuang12 = new Shuang12();
        CuXiaoContext cuXiaoContext = new CuXiaoContext(shuang12);
        cuXiaoContext.use();
    }
}
interface CuXiao {
    void cuxiao();
}
class CuXiaoContext {

    private CuXiao cuXiao;

    public CuXiaoContext(CuXiao cuXiao) {
        this.cuXiao = cuXiao;
    }
    public void use(){
        cuXiao.cuxiao();
    }
}
class Shuang11 implements CuXiao {
    @Override
    public void cuxiao() {
        System.out.println("双十一");
    }
}
class Shuang12 implements CuXiao {
    @Override
    public void cuxiao() {
        System.out.println("双十二");
    }
}